const baseurl = "https://wanghuiwen.com/game/api";
layui.use(['table'], function () {
    var $ = layui.jquery;
    var table=layui.table;
    $.ajaxSetup({
        contentType:"application/x-www-form-urlencoded;charset=utf-8",
        beforeSend: function (xhr) {
            xhr.setRequestHeader("authorization", localStorage.getItem("token")==null?"":localStorage.getItem("token"));
        },
        complete:function(XMLHttpRequest,textStatus){
        },
        error:function (data) {
            // console.log(data)
            // if(data.status==401){
            //     window.location.href="login"
            // }
        }
    });
    table.set({
        headers: {"authorization": localStorage.getItem("token")==null?"":localStorage.getItem("token")}
    })
});
    if(typeof jQuery != 'undefined' ){
        $.ajaxSetup({
            contentType:"application/x-www-form-urlencoded;charset=utf-8",
            beforeSend: function (xhr) {
                xhr.setRequestHeader("authorization", localStorage.getItem("token")==null?"":localStorage.getItem("token"));
            },
            complete:function(XMLHttpRequest,textStatus){
            }
            ,error:function (data) {
                // console.log(data)
                // if(data.status==401){
                //     window.location.href="login"
                // }
            }
        });
    }


